package org.wangp.framework.db.domain;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;

/**
 * @author wangpeng (๑•ᴗ•๑)
 * @date 2021/10/10 22:47
 */
public class BaseDO implements Serializable {

	private static final long serialVersionUID = -1090341844684982494L;

	protected String creator;
	@TableField(fill = FieldFill.INSERT)
	protected LocalDateTime created;
	protected String editor;
	@TableField(fill = FieldFill.UPDATE)
	protected LocalDateTime edited;
	@TableField(fill = FieldFill.INSERT)
	protected short isDel;

	public String getCreator() {
		return this.creator;
	}

	public void setCreator(final String creator) {
		this.creator = creator;
	}

	public LocalDateTime getCreated() {
		return this.created;
	}

	public void setCreated(final LocalDateTime created) {
		this.created = created;
	}

	public String getEditor() {
		return this.editor;
	}

	public void setEditor(final String editor) {
		this.editor = editor;
	}

	public LocalDateTime getEdited() {
		return this.edited;
	}

	public void setEdited(final LocalDateTime edited) {
		this.edited = edited;
	}

	public short getIsDel() {
		return this.isDel;
	}

	public void setIsDel(final short isDel) {
		this.isDel = isDel;
	}

	@Override
	public boolean equals(final Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || this.getClass() != o.getClass()) {
			return false;
		}
		final BaseDO baseDO = (BaseDO) o;
		return this.isDel == baseDO.isDel && Objects.equals(this.creator, baseDO.creator)
				&& Objects.equals(this.created, baseDO.created) && Objects.equals(this.editor, baseDO.editor)
				&& Objects.equals(this.edited, baseDO.edited);
	}

	@Override
	public int hashCode() {
		return Objects.hash(this.creator, this.created, this.editor, this.edited, this.isDel);
	}

	@Override
	public String toString() {
		return "BaseDO{" + "creator='" + this.creator + '\'' + ", created=" + this.created + ", editor='" + this.editor
				+ '\'' + ", edited=" + this.edited + ", isDel=" + this.isDel + '}';
	}
}
